from datetime import datetime

from games.models import UserRecord


class Plattime(object):
    def __init__(self):
        self.plat = UserRecord.objects.all().order_by('-add_time').first()

    def timers(self):
        # print(plat.nper)
        zy = self.plat.nper.split('-')[-1]

        times = datetime.now()
        tes = times.strftime('%Y-%m-%d')
        while True:
            count = str(int(zy)+1)

            if len(count) == 1:
                count = "000" + count
            elif len(count) == 2:
                count = "00" + count
            elif len(count) == 3:
                count = "0" + count
            timesr = str(tes + "-%s" % (count))

            return timesr

Plattime().timers()